//
//  ZMainController.m
//  NewProject
//
//  Created by 陈洪鑫 on 2018/4/13.
//  Copyright © 2018年 chenIos. All rights reserved.
//

#import "ZMainController.h"
#import "ZBaseNaviController.h"
#import "ZPropertyController.h"
#import "ZMyController.h"
#import "ZMarketController.h"
#import "ZWalletController.h"
@implementation ZMainController
- (void)viewDidLoad
{
    [super viewDidLoad];
    [self.tabBar setTranslucent:NO];
    self.tabBar.barTintColor = COLOR_TABBAR;
    self.tabBar.tintColor = COLOR_BLUE;
    [[UITabBar appearance] setShadowImage:[UIImage new]];
    [[UITabBar appearance] setBackgroundImage:[[UIImage alloc]init]];
    
    
    ZPropertyController  *properyVC = [ZPropertyController new];
    ZWalletController *walletVC = [ZWalletController new];
    ZMyController    *myVC = [ZMyController new];

   
    [self setupController:properyVC Title:Z_Location(@"tabBarAssets") image:[UIImage imageNamed:@"property"] selectedImage:[UIImage imageNamed:@"property_un"]];

    [self setupController:walletVC Title:Z_Location(@"tabBarWallet") image:[UIImage imageNamed:@"wallet"] selectedImage:[UIImage imageNamed:@"wallet_un"]];
   
     [self setupController:myVC Title:Z_Location(@"tabBarProfile") image:[UIImage imageNamed:@"myproperty"] selectedImage:[UIImage imageNamed:@"myproperty_un"]];
}

- (void)setupController:(ZBaseController *)controller Title:(NSString *)title image:(UIImage *)image selectedImage:(UIImage *)selectedImage{
    ZBaseNaviController *nav = [[ZBaseNaviController alloc]initWithRootViewController:controller];
//    nav.title = title;
    controller.title = title;
//    nav.tabBarItem.title = title;
//    nav.title = title;
//    
    self.tabBarItem.title = title;
    controller.tabBarItem.image = image;
    controller.tabBarItem.selectedImage = selectedImage;
    [self addChildViewController:nav];
    
}
@end
